/*
 * log.c
 *
 * API for connecting to log file and sending new messages or errors.
 *
 *  Created on: Jun 26, 2011
 *      Authors: Lane Aasen, Nikholas Gaffney, Michael Rosenberger, Dylan Swiggett
 */

#include <stdio.h>

FILE *logFile;

void initLog(){
	logFile = fopen("log.txt", "a+");
}

void messageLog(char message[]){
	fprintf(logFile, message);
	fprintf(logFile, "\n");
}

void errorLog(char error[]){
	perror(error);
	fprintf(logFile, "Error: ");
	fprintf(logFile, error);
	fprintf(logFile, "\n");
}

void endLog(){
	fclose(logFile);
}
